#!/bin/bash
echo "【FROM】 $1 "
echo "↓ 迁移到 ↓"
echo "【TO】$2"
from=$1
to=$2

workspace="workspace-ZB_18558992"
rm -rf $workspace
mkdir $workspace
cd $workspace

echo ""
echo "【执行命令】git clone --bare $from"
git clone --bare $from

filename=`ls | awk '{print $1}'`
cd $filename
echo ""
echo "【执行命令】git push --mirror $to"
git push --mirror $to

cd ../..
rm -rf $workspace
echo ""
echo "【迁移成功】请在$2仓库检查迁移效果"
